<template>
  <div class="ycdwrap">
    <div class="yc-table-wrp">
      <div>
        <yc-title  class="title" value="商品详情"></yc-title>
      </div>
      <el-form @submit.native.prevent :model="form" label-width="80px">
        <el-form-item label="商品名称:">
          <label>{{cmdParams.row.good_name}}</label>
        </el-form-item>
        <el-form-item label="商品图:">
          <img  :src="cmdParams.imgPath + cmdParams.row.good_image" class="avatar">
        </el-form-item>
        <el-form-item label="商品编码:">
          <label>{{cmdParams.row.good_code}}</label>
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>

<script>
import ycTitle from '@/components/ycTitle.vue'
import ycButton from '@/components/button.vue'
import ycInput from '@/components/yc-input.vue'
import ycSearchButton from '@/components/searchButton.vue'
export default {
  name: 'goodDetail',
  components: {
    ycTitle,
    ycButton,
    ycSearchButton,
    ycInput
  },
  data () {
    return {
      active1: true,
      active2: false,
      cmdParams: {},
      form: {
        good_name: '',
        good_image: '',
        good_code: ''
      }
    }
  },
  methods: {
  },
  created () {
    const tempData = localStorage.getItem('tempData')
    if (tempData) {
      this.cmdParams = JSON.parse(tempData)
    } else {
      this.cmdParams = this.$route.params
      localStorage.setItem('tempData', JSON.stringify(this.$route.params))
    }
  },
  beforeDestroy () {
    localStorage.removeItem('tempData')
  }
}
</script>

<style lang="stylus" scoped="scoped">
  .yc-table-wrp{
    .preservation{
      width 100px
      height 30px
      font-size 16px
    }
  }
</style>
<style>
.avatar-uploader{
  display: inline-block;
}
.avatar-uploader .el-icon-label{
  position: absolute;
  top: -6px;
  right: -15px;
  display: block;
  width: 46px;
  height: 26px;
  background-color: #13ce66;
  transform: rotate(45deg);
  z-index: 99;
}
.avatar-uploader .el-icon-label .el-cion{
  position: absolute;
  transform: rotate(-45deg);
  top: 40%;
  right: 34%;
  color: #FFFFFF;
}
.avatar-uploader .el-upload {
  border: 1px dashed #d9d9d9;
  margin: 0 10px 0 0;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  width: 178px;
  height: 178px;
}
.avatar-uploader .el-upload:hover {
  border-color: #409EFF;
}
.avatar-uploader-icon {
  font-size: 28px;
  color: #8c939d;
  width: 178px;
  height: 178px;
  line-height: 178px;
  text-align: center;
}
.avatar{
  display: block;
  width: 178px;
  height: 178px;
}
</style>
